package com.nkzy.controller;

import com.nkzy.domain.pojo.Result;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
@CrossOrigin//后端进行跨域处理
public class TbDeptController {
    // 测试接口
    @GetMapping("/data")
    public Result getData() {
        return Result.success("This is test data");
    }

    // 添加 depts/getall 接口
    @GetMapping("/get")
    public Result getAllDepts() {
        // 这里应该返回实际的部门数据
        return Result.success("Department data");
    }
}